package com.DHH.Service.Identity.Impl;
import com.DHH.Entity.Identity.IdentityAuthenticationRecord;
import com.DHH.Mapper.Identity.IdentityAuthenticationRecordMapper;
import com.DHH.Service.Identity.IIdentityAuthenticationRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class IdentityAuthenticationRecordServiceImpl implements IIdentityAuthenticationRecordService{
	
	@Autowired
    private IdentityAuthenticationRecordMapper identityAuthenticationRecordMapper;
    
   @Override
   public IdentityAuthenticationRecord insertIdentityAuthenticationRecord(IdentityAuthenticationRecord identityAuthenticationRecord){
	   
        identityAuthenticationRecordMapper.insertSelective(identityAuthenticationRecord);
	   return identityAuthenticationRecord;
	   
   };
   @Override
   public IdentityAuthenticationRecord updateIdentityAuthenticationRecord(IdentityAuthenticationRecord identityAuthenticationRecord){
	     int x=identityAuthenticationRecordMapper.updateByPrimaryKeySelective(identityAuthenticationRecord);
	     if(x==1){

         }
        return identityAuthenticationRecord;
   };
   @Override
   public IdentityAuthenticationRecord deleteIdentityAuthenticationRecord(IdentityAuthenticationRecord identityAuthenticationRecord){

	     identityAuthenticationRecordMapper.delete(identityAuthenticationRecord);
        return identityAuthenticationRecord;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public IdentityAuthenticationRecord saveOrUpdateIdentityAuthenticationRecord(IdentityAuthenticationRecord identityAuthenticationRecord){
        if(identityAuthenticationRecord.getId()==null)
        {
            identityAuthenticationRecordMapper.insertSelective(identityAuthenticationRecord);
        }else{
            identityAuthenticationRecordMapper.updateByPrimaryKeySelective(identityAuthenticationRecord);
        }
        return identityAuthenticationRecord;
    };
}
